<!--************************************************************ -->
<!--* 文件创建日期：2010                                  * -->
<!--* 文件修改日期：			                                   * -->
<!--************************************************************ -->
<!--JSP初始化设置-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.infomanage.po.*" %>
<%@page import="com.infomanage.vo.*" %>
<%@page import="com.infomanage.service.plan.*"%>
<%@page import="com.infomanage.util.Consts"%>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<html>
<%
	request.setCharacterEncoding("UTF-8");
	String itemId = request.getParameter("itemId");
    if(itemId == null) itemId = "";
%>
<head>
	<title>图片上传</title>
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">	
	<link href="<%=request.getContextPath() %>/css/table.css" rel="stylesheet" type="text/css">
	<link href="<%=request.getContextPath() %>/css/calendar.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/js/calendar.js"></script>
	<script type="text/javascript">
	   function init() {
		   if("" != "<%=itemId%>") { // 修改
		   }
	   }
	   // 提交
	   function doSubmit(){
		    if(!isvalidatefile()){
		    	return;
		    }
		 	if("" == "<%=itemId%>") {
		 		form1.actionType.value = "add";
			}else {
		 		form1.actionType.value = "modify";
			}
		 	form1.submit();
	   }

	   function showError(error){
		   alert(error);
	   }

	   function showInfo(info, picDir){
		   alert(info);
		   window.returnValue = picDir;
		   window.close();
	   }
	   
	   function isvalidatefile(){
			var extend = form1.file.value.substring(form1.file.value.lastIndexOf(".")+1);
			    if(extend==""){
			       alert("请上传后缀名为jpg、gif、png、bmp或dwg的图片!");
			       return false;
		    }else{
				if(!(extend=="jpg"||extend=="gif"||extend=="png"||extend=="bmp"||extend=="dwg")){
				   alert("请上传后缀名为jpg、gif、png、bmp或dwg的图片!");
			   return false;
			  }
			    }
		   return true;
		}
	</script>
</head>
<body  rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0"  onload="init();">
	<form name="form1" action="preventCheck_action.jsp" method="post" target="actionFrame" enctype="multipart/form-data">
	<input type="hidden" name="itemId" value="">
	<input type="hidden" name="actionType" value="upload">
	<table class="dialogTable" cellpadding="0" cellspacing="0">
		<!-- 表头-->
		<tr class="dialogTableHeader">
			<td>图片上传</td>
		</tr>
		<!-- 表数据-->
		<tr class="dialogTableContent">
			<td>
				<!-- 数据项 -->
				<table class="dataTable">
					<col width="30%">
					<col width="70%">
					<tr>
						<td class="field">
							上传
						</td>
						<td>
							<input name="file" value="" type="file" style="width: 250px;"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="tableBtn">
				<span onclick="doSubmit();">上传</span>
				<span onclick="window.close();">取消</span>
			</td>
		</tr>
		<tr valign="top">
			<td colspan="2">
				&nbsp;
			</td>
		</tr>
	</table>
	</form>
	<iframe src="#" name="actionFrame" style="display: none;"></iframe>
</body>
</html>